<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<sfa:mainTitle></sfa:mainTitle>
<%@ include file="/common/meta.jsp"%>
<script type="text/javascript">
	$(document).ready(function(){
		if("${msg}")
		alert("${msg}");
});
</script>
		<script type="text/javascript">
$(function() {
	$(".deleteMeeting").click(function() {
		var saleMeetingId = $(this).attr("saleMeetingId");
		//alert(saleNewsId);
			var url = "${path}/users/meeting/index/delete/" + saleMeetingId;
			art.dialog( {
				lock : true,
				content : '确定要删除吗?',
				ok : function() {
					art.dialog( {
						id : "loading",
						lock : true,
						drag : false,
						resize : false,
						title : "正在删除...",
						time : 5
					});
					$.post(url, null, function(result) {
						art.dialog( {
							id : 'loading'
						}).close();//关闭等待框
							if (result.isDel) {
								art.dialog( {
									icon : "succeed",
									content : "删除成功!",
									lock : true,
									ok : function() {
										location.reload();
									}
								});
							} else {
								art.dialog( {
									icon : "error",
									content : "删除失败!",
									lock : true,
									ok : true
								});
							}

						});

					return true;
				},
				cancelVal : '关闭',
				cancel : true
			//为true等价于function(){}
					});

		});
		
		
		$(".apply").click(function() {
		var saleMeetingId = $(this).attr("saleMeetingId");
		var status=$(this).attr("status");
		//alert(saleNewsId);
			var url = "${path}/users/meeting/index/apply?status="+status+"&saleMeetingId=" + saleMeetingId;
			art.dialog( {
				lock : true,
				content : '确定要执行吗?',
				ok : function() {
					art.dialog( {
						id : "loading",
						lock : true,
						drag : false,
						resize : false,
						title : "正在提交...",
						time : 5
					});
					$.post(url, null, function(result) {
					//alert(result.isDel);
						art.dialog( {
							id : 'loading'
						}).close();//关闭等待框
							if (result.isDel) {
								art.dialog( {
									icon : "succeed",
									content : "操作成功!",
									lock : true,
									ok : function() {
										location.reload();
									}
								});
							} else {
								art.dialog( {
									icon : "error",
									content : "操作失败!",
									lock : true,
									ok : true
								});
							}

						});

					return true;
				},
				cancelVal : '关闭',
				cancel : true
			//为true等价于function(){}
					});

		});

});
</script>

	</head>

	<body id="master">

		<sfa:mainHeader></sfa:mainHeader>
		<div class="main">

			<h1>
				管理早会
			</h1>
			<hr />

			<div class="in">
				<form method="get">
					<table width="100%" border="0" cellspacing="0" cellpadding="10"
						class="serch_table">
						<tbody>
							
							
							<tr>
							<td class="table_title">
									<span>早会标题</span>

								</td>
								<td>
									<input type="text" name="meetingTitle" id="meetingTitle"
										class="inputbox" value="${meetingTitle}">
								</td>
								<td class="table_title">
									<span>早会内容</span>
								</td>
								<td>
									<input type="text" name="meetingContent" id="meetingContent"
										class="inputbox" value="${meetingContent}">
								</td>
								<td class="table_title">
									<span>审核状态</span>
								</td>
								<td>
									<sfa:dic showType="select" kindNo="APPLYSTATUS" def="ALL:全部;"
										attr="class='selectbox'" name="meetingStatus" id="meetingStatus"
										code="${meetingStatus}">
									</sfa:dic>
								</td>
								<!--<td class="table_title">
									<span>主持人</span>
								</td>
								<td>
									<input type="text" name="masterName" id="masterName"
										class="inputbox" value="${masterName}">

								</td>


							--></tr>
							
							
							<tr>
								<td class="table_title">
									<span>早会开始</span>
								</td>
								<td>
									<input id="beginCreateDate" name="beginCreateDate" type="text"
										onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
										class="Wdate inputbox" readOnly="true"
										value="${beginCreateDate}" />
								</td>

								<td class="table_title">
									<span>早会结束</span>
								</td>
								<td>
									<input id="endCreateDate" name="endCreateDate" type="text"
										onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
										class="Wdate inputbox" readOnly="true"
										value="${endCreateDate}" />
								</td>

								

							</tr>


							<tr>
								<td colspan="6" class="table_btn">
									<input type="submit" class="com_btn" value="查询" />
									<input type="button" class="com_btn" value="清空"
										onclick="location.href='${path}/users/meeting/index/getmeetings';" />
								</td>
							</tr>
						</tbody>
					</table>
				</form>

				<table width="100%" border="0" cellspacing="0" cellpadding="10"
					class="table_list">
					<tbody>
						<tr class="tabheader">
							<td>
								<span>早会标题</span>
							</td>
							<td>
								<span>主持人</span>
							</td>
							
							<td>
								<span>创建时间</span>
							</td>
							<td>
								<span>早会开始</span>
							</td>
							<td>
								<span>早会结束</span>
							</td>
							<td>
								<span>审核状态</span>
							</td>
							<td>
								<span>操作</span>
							</td>

						</tr>
						<c:forEach items="${pagination.resultList}" var="meeting">
							<tr class="gray datarow">
								<td>
									<span>${meeting.meetingTitle }</span>
								</td>

								<td>
									<span>${ meeting.masterName}
									</span>
								</td>

								
								<td>
									<span><fmt:formatDate value="${meeting.createDate }"
											pattern="yyyy-MM-dd HH:mm:ss" />
									</span>
								</td>
								
								<td>
									<span><fmt:formatDate value="${meeting.startDate }"
											pattern="yyyy-MM-dd HH:mm:ss" />
									</span>
								</td>
								
								<td>
									<span><fmt:formatDate value="${meeting.endDate }"
											pattern="yyyy-MM-dd HH:mm:ss" />
									</span>
								</td>
								<td>
									<span><sfa:dic showType="value" 
										code="${meeting.meetingStatus}">
									</sfa:dic></span>
								</td>
								<td>
								<c:set value="${meeting.meetingStatus}" var="status"></c:set>
									<a
										href="${path}/users/meeting/index/view?saleMeetingId=${meeting.saleMeetingId}">查看</a>
										
									<c:if test="${status=='APPLYSTATUS_1' || status=='APPLYSTATUS_4'}">
									<span class="v_line">| </span>
									<a
										href="${path}/users/meeting/index/updatemeeting/${meeting.saleMeetingId}">编辑</a>
									</c:if>
									
									<c:if test="${status!='APPLYSTATUS_2'}">
									<span class="v_line">| </span>
									<a href="javascript:void(0);" class="deleteMeeting"
										saleMeetingId="${meeting.saleMeetingId}">删除</a>
										</c:if>
										
									<c:if test="${status=='APPLYSTATUS_1'}">
									<span class="v_line">| </span>
									<a href="javascript:void(0);" class="apply"
										saleMeetingId="${meeting.saleMeetingId}" status="APPLYSTATUS_2">申请审核</a>
										</c:if>
										
									<c:if test="${status!='APPLYSTATUS_1'}">
									<span class="v_line">| </span>
									<a href="javascript:void(0);" class="apply"
										saleMeetingId="${meeting.saleMeetingId}" status='APPLYSTATUS_1'>取消申请</a>
										</c:if>
									
			
								</td>
							</tr>
						</c:forEach>

						<tr class="tabfooter">
							<td colspan="8" align="right">
								<!--  PAGINATION START  -->
								<div class="pagination">
									${pagination.multiPage}
								</div>
								<!--  PAGINATION END  -->
							</td>
						</tr>
				</table>
			</div>
		</div>

		<sfa:mainFooter></sfa:mainFooter>

	</body>
</html>


